/* 1videoConference -- An open source video conferencing platform.
* Copyright (C) 2007 - 2008, Adiance Technologies Pvt. Ltd.
*
* Hardik Sanghvi <hardik.sanghvi @adiance.com>
*
* See http://www.1videoconference.org for more information about
* the 1videoConference project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, forums and mailing lists
* for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
********************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.PeerResolvers;
using NetPeerService;
using System.Windows;

namespace _videoConference.BAL
{
    public static class PeerServices
    {
        public static IPageNavigationChannel channelPageNav;
        public static IPodResizeChannel channelPodResize;
                
        public static NetPeerClient clientPageNav;
        public static NetPeerClient clientPodResize;

        public static object objectPageNav = null;
        public static object objectPodResize = null;
                
        public static void OpenChannels()
        {
            try
            {
                objectPageNav = new PageNavigationClass();
                clientPageNav = new NetPeerClient();
                channelPageNav = (IPageNavigationChannel)clientPageNav.OpenClient<IPageNavigationChannel>("net.tcp://" + UserInfo.CreMachName + ":2500/PageNavigation", "PageNavigationMeshM" + UserInfo.MeetingID, ref objectPageNav);

                objectPodResize = new PodResizeClass();
                clientPodResize = new NetPeerClient();
                channelPodResize = (IPodResizeChannel)clientPodResize.OpenClient<IPodResizeChannel>("net.tcp://" + UserInfo.CreMachName + ":2500/PodResize", "PodResizeMeshM" + UserInfo.MeetingID, ref objectPodResize);
            }
            catch (Exception exp)
            {
                //MessageBox.Show("PeerServices.OpenChannels()" + exp.Message);
                exp.Data.Add("My Key", "1videoConference--:--PeerServices.cs--:--OpenChannels()--:--");
                clsUtility.LogException = exp;
            }           
        }
    }
}
